//
//  PuzzleViewController.h
//  ImageAnimation
//
//  Created by apple on 5/11/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#define LEVEL_NUMBER 3
#import <QuartzCore/QuartzCore.h>
#import <UIKit/UIKit.h>
#import "MovingCommand.h"

@class FixFrame;
@class DraggableView;
@class StartViewController;
@interface PuzzleViewController : UIViewController{
    
    int position;
    NSTimer *timer;
    NSMutableArray *array;
    
    NSMutableArray *fixFrameArray;
    FixFrame *canFillFrame;
    NSMutableArray *usedImagesArray;
    __unsafe_unretained IBOutlet UIView *panelView;

    UIView *menuView;
}

@property (nonatomic,retain) UIImage *imageFromUser;
@property (nonatomic,retain) MovingCommand *movingCommand;
@property (nonatomic,assign) NSInteger rowsCount;
@property (nonatomic,assign) NSInteger columnsCount;
@property (nonatomic,retain) FixFrame *clearFixFrame;
@property (nonatomic,retain) StartViewController *startViewController;
@property (nonatomic,retain) CAEmitterLayer	*heartsEmitter;
- (void)runAnimation;
- (NSMutableArray *)devideImage:(UIImage *)image;

- (FixFrame *)findFixFrameHorizontal:(NSInteger)h andVertical:(NSInteger)v;
- (CGRect)getFrameFromHorizontal:(NSInteger)h andVertical:(NSInteger)v;
- (CGRect)getFrameFromPosition:(NSInteger)position;
- (void)draggableViewDidMove;
- (IBAction)messUpImagesInThePanel:(id)sender;
- (IBAction)clickBack:(id)sender;
- (void)youWin __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);
- (void)initEmitter __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);
@end
